package adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;
import bean.NoticeBean;
import student.andlei.com.student.R;

public class NoticeAdapter extends BaseQuickAdapter<NoticeBean,BaseViewHolder>{
    public NoticeAdapter(int layoutResId, @Nullable List<NoticeBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NoticeBean item) {
        helper.setText(R.id.tv_title,item.title);
        helper.setText(R.id.tv_content,item.content);
        helper.setText(R.id.tv_time,item.create_time);
        if(item.is_new.equals("1")){
            helper.getView(R.id.red_point).setVisibility(View.VISIBLE);
        }else {
            helper.getView(R.id.red_point).setVisibility(View.GONE);
        }
    }
}
